<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="./axios.js"></script>
    <script>
        axios.defaults.baseURL = 'http://www.itcbc.com:3006'
        let a1 = axios.get('/api/province')
        let a2 = axios.get('/api/city', { params: { pname: '河南省' } })
        let a3 = axios.get('/api/county', { params: { pname: '河南省', cname: '信阳市' } })
        // all全部（所有）   race比赛
        Promise.all([a1, a2, a3]).then(result => {
            console.log(result) //所有
        })
        Promise.race([a1, a2, a3]).then(result => {
            console.log(result) //最快的结果
        })

        // --resolve(得到成功状态)\reject(获取失败状态)
        // Promise.resolve('成功获取数据').then(result => {
        //         console.log('成功',result)
        //     }).catch(error => {
        //         console.log('失败',error)
        //     })
        //     Promise.reject('发生失败').then(result => {
        //         console.log('成功',result)
        //     }).catch(error => {
        //         console.log('失败',error)
        //     })


    </script>
</body>

</html>